package com.huluobo.h3kotlinproject.home

import android.view.LayoutInflater
import android.view.ViewGroup
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.h3kotlinproject.R
import com.huluobo.h3kotlinproject.databinding.ItemNavBinding

/**
 *  Created by LC on 2023/10/23.
 */
class NavAdapter(list: MutableList<NavGoodsBean>) :
    BaseQuickAdapter<NavGoodsBean, NavAdapter.NavViewHolder>(R.layout.item_nav, list) {
    override fun convert(holder: NavViewHolder, item: NavGoodsBean) {
        holder.binding.navBean = item
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NavViewHolder {
        val dataBinding = ItemNavBinding.inflate(LayoutInflater.from(parent.context), parent, false)
        return NavViewHolder(dataBinding)
    }

    class NavViewHolder(var binding: ItemNavBinding) : BaseViewHolder(binding.root)
}